package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopContactMapper;
import com.ruoyi.system.domain.ShopContact;
import com.ruoyi.system.service.IShopContactService;

/**
 * 联系人Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-15
 */
@Service
public class ShopContactServiceImpl implements IShopContactService 
{
    @Autowired
    private ShopContactMapper shopContactMapper;

    /**
     * 查询联系人
     * 
     * @param contactId 联系人主键
     * @return 联系人
     */
    @Override
    public ShopContact selectShopContactByContactId(Long contactId)
    {
        return shopContactMapper.selectShopContactByContactId(contactId);
    }

    /**
     * 查询联系人列表
     * 
     * @param shopContact 联系人
     * @return 联系人
     */
    @Override
    public List<ShopContact> selectShopContactList(ShopContact shopContact)
    {
        return shopContactMapper.selectShopContactList(shopContact);
    }

    /**
     * 新增联系人
     * 
     * @param shopContact 联系人
     * @return 结果
     */
    @Override
    public int insertShopContact(ShopContact shopContact)
    {
        shopContact.setCreateTime(DateUtils.getNowDate());
        return shopContactMapper.insertShopContact(shopContact);
    }

    /**
     * 修改联系人
     * 
     * @param shopContact 联系人
     * @return 结果
     */
    @Override
    public int updateShopContact(ShopContact shopContact)
    {
        shopContact.setUpdateTime(DateUtils.getNowDate());
        return shopContactMapper.updateShopContact(shopContact);
    }

    /**
     * 批量删除联系人
     * 
     * @param contactIds 需要删除的联系人主键
     * @return 结果
     */
    @Override
    public int deleteShopContactByContactIds(Long[] contactIds)
    {
        return shopContactMapper.deleteShopContactByContactIds(contactIds);
    }

    /**
     * 删除联系人信息
     * 
     * @param contactId 联系人主键
     * @return 结果
     */
    @Override
    public int deleteShopContactByContactId(Long contactId)
    {
        return shopContactMapper.deleteShopContactByContactId(contactId);
    }
}
